package com.sunlake.spring.main.model.counselor.po;

import lombok.Data;

import java.time.LocalDateTime;

/**
 * 
 * @TableName resumes
 */
@Data
public class ResumesPO {
    /**
     * 
     */
    private Long id;

    /**
     * 同一份简历的组 id（UUID 格式），便于多版本管理
     */
    private String resumeUid;

    /**
     * 所属用户
     */
    private Integer userId;

    /**
     * 版本号，从1开始递增（应用层维护）
     */
    private Integer version;

    /**
     * 是否为当前/最新版本（1 是）
     */
    private Integer isCurrent;

    /**
     * 简历标题/职位意向
     */
    private String title;

    /**
     * 求职目标/一句话概述（可用于快速展示/搜索）
     */
    private String objective;

    /**
     * 解析后的结构化简历（JSON）
     */
    private Object parsedJson;

    /**
     * 纯文本（全量文本，用于全文检索）
     */
    private String parsedText;

    /**
     * 对应上传的文件元数据
     */
    private Long fileId;

    /**
     * 
     */
    private Object visibility;

    /**
     * 
     */
    private LocalDateTime createdAt;

    /**
     * 
     */
    private LocalDateTime updatedAt;

    /**
     * 软删除时间
     */
    private LocalDateTime deletedAt;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        ResumesPO other = (ResumesPO) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
            && (this.getResumeUid() == null ? other.getResumeUid() == null : this.getResumeUid().equals(other.getResumeUid()))
            && (this.getUserId() == null ? other.getUserId() == null : this.getUserId().equals(other.getUserId()))
            && (this.getVersion() == null ? other.getVersion() == null : this.getVersion().equals(other.getVersion()))
            && (this.getIsCurrent() == null ? other.getIsCurrent() == null : this.getIsCurrent().equals(other.getIsCurrent()))
            && (this.getTitle() == null ? other.getTitle() == null : this.getTitle().equals(other.getTitle()))
            && (this.getObjective() == null ? other.getObjective() == null : this.getObjective().equals(other.getObjective()))
            && (this.getParsedJson() == null ? other.getParsedJson() == null : this.getParsedJson().equals(other.getParsedJson()))
            && (this.getParsedText() == null ? other.getParsedText() == null : this.getParsedText().equals(other.getParsedText()))
            && (this.getFileId() == null ? other.getFileId() == null : this.getFileId().equals(other.getFileId()))
            && (this.getVisibility() == null ? other.getVisibility() == null : this.getVisibility().equals(other.getVisibility()))
            && (this.getCreatedAt() == null ? other.getCreatedAt() == null : this.getCreatedAt().equals(other.getCreatedAt()))
            && (this.getUpdatedAt() == null ? other.getUpdatedAt() == null : this.getUpdatedAt().equals(other.getUpdatedAt()))
            && (this.getDeletedAt() == null ? other.getDeletedAt() == null : this.getDeletedAt().equals(other.getDeletedAt()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getResumeUid() == null) ? 0 : getResumeUid().hashCode());
        result = prime * result + ((getUserId() == null) ? 0 : getUserId().hashCode());
        result = prime * result + ((getVersion() == null) ? 0 : getVersion().hashCode());
        result = prime * result + ((getIsCurrent() == null) ? 0 : getIsCurrent().hashCode());
        result = prime * result + ((getTitle() == null) ? 0 : getTitle().hashCode());
        result = prime * result + ((getObjective() == null) ? 0 : getObjective().hashCode());
        result = prime * result + ((getParsedJson() == null) ? 0 : getParsedJson().hashCode());
        result = prime * result + ((getParsedText() == null) ? 0 : getParsedText().hashCode());
        result = prime * result + ((getFileId() == null) ? 0 : getFileId().hashCode());
        result = prime * result + ((getVisibility() == null) ? 0 : getVisibility().hashCode());
        result = prime * result + ((getCreatedAt() == null) ? 0 : getCreatedAt().hashCode());
        result = prime * result + ((getUpdatedAt() == null) ? 0 : getUpdatedAt().hashCode());
        result = prime * result + ((getDeletedAt() == null) ? 0 : getDeletedAt().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", resumeUid=").append(resumeUid);
        sb.append(", userId=").append(userId);
        sb.append(", version=").append(version);
        sb.append(", isCurrent=").append(isCurrent);
        sb.append(", title=").append(title);
        sb.append(", objective=").append(objective);
        sb.append(", parsedJson=").append(parsedJson);
        sb.append(", parsedText=").append(parsedText);
        sb.append(", fileId=").append(fileId);
        sb.append(", visibility=").append(visibility);
        sb.append(", createdAt=").append(createdAt);
        sb.append(", updatedAt=").append(updatedAt);
        sb.append(", deletedAt=").append(deletedAt);
        sb.append("]");
        return sb.toString();
    }
}